package com.hhp.cloud.shop.admin.pojo.vo.menu;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 路由菜单
 *
 * @author hhp
 * @version 1.0
 * @date 2022-04-21 15:15
 */
@Data
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class RouteVO {
    private Long id;

    private Long parentId;

    private String path;

    private String component;

    private String redirect;

    /**
     * 如果设置为 true
     */
    private Boolean alwaysShow;

    private String name;

    private Integer sort;

    private Boolean hidden;

    /**
     * 菜单类型
     */
    private Integer type;

    private Meta meta;

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class Meta {
        private String title;//路由title  一般必填
        private String icon;//图标，也是菜单图标
        private String frameSrc;//内嵌iframe的地址
        private Boolean hideMenu;//
        private Integer dynamicLevel;//动态路由可打开Tab页数
        private Boolean ignoreAuth;//是否忽略权限，只在权限模式为Role的时候有效
        private String transitionName;//指定该路由切换的动画名
        private Boolean hideBreadcrumb;//隐藏该路由在面包屑上面的显示
        private Boolean ignoreRoute;//忽略路由。用于在ROUTE_MAPPING以及BACK权限模式下，生成对应的菜单而忽略路由。2.5.3以上版本有效
        private Boolean hideChildrenInMenu;//隐藏所有子菜单
        private Boolean hidePathForChildren;// 是否在子级菜单的完整path中忽略本级path。2.5.3以上版本有效
        private List<String> roles;//可以访问的角色 只在权限模式为Role的时候有效
    }
    private List<RouteVO> children;
}
